package Model;

/**
 * This class contains all the CONSTANT/PARAMETERS to balance from start
 */
public class Parameter {

    private static int maxAmountBrought = 15;
    /**
     * parameter corresponding to the total width of the board
     */
    private static int widthBoard = 25;
    /**
     * parameter corresponding to the total height of the board
     */
    private static int heightBoard = 25;
    /**
     * The different decision choices possible for each being, one action a
     * step.
     */
    // Move(POI) - Escape - DoAction - 
    // nothing -> not in DecisionMatrix
    private static int numberChoiceDecision = 4;
    /**
     * parameter corresponding to the max scale of speed possible.
     */
    private static int effectiveSpeed = 2;
    private static int villagerSpeed = 2;
    private static int villagerVisionRadius = 4;
    private static int animalSpeed = 2;
    private static int animalVisionRadius = 2;
    /**
     * parameters to change the percentage of resources in initGameBoard
     */
    private static double[] resourcesParameters = new double[8];
    /**
     * Max Distance to set good weight in DecisionMatrix for POI only
     */
    // used for POI
    private static int maxDistance = 10;
    /**
     * Max Distance to set good weight in DecisionMatrix for Escape coefficient only
     */
    // used for escape coefficient
    private static int maxFearDistance = 10;
    /**
     * Weight for the action on Hand To Hand
     */
    private static int actionWeight = 10;
    private static int targetWeight = 50;

    /**
     * Weight for the action on Hand To Hand
     */
    public static int getActionWeight() {
        return actionWeight;
    }

    public static void setActionWeight(int actionWeight) {
        Parameter.actionWeight = actionWeight;
    }
    private static boolean generalHold = false;
    private static boolean beingHold = false;
    private static boolean gameHold = false;

    private static int gameDelay = 100;
    
    static int getGameDelay() {
        return gameDelay;
    }

    public Parameter() {
    }

    public static int getWidthBoard() {
        return widthBoard;
    }

    public static int getHeightBoard() {
        return heightBoard;
    }

    public static int getNumberChoiceDecision() {
        return numberChoiceDecision;
    }

    public static int getEffectiveSpeed() {
        return effectiveSpeed;
    }

    public static double[] getResourcesParameters() {
        return resourcesParameters;
    }

    public static double[] getResourcesParametersForNormalMap() {
        setResourcesParametersForNormalMap();
        return resourcesParameters;
    }

    public static double[] getResourcesParametersForPlainMap() {
        setResourcesParametersForPlainMap();
        return resourcesParameters;
    }

    public static double[] getResourcesParametersForAquaticMap() {
        setResourcesParametersForAquaticMap();
        return resourcesParameters;
    }

    /**
     * Max Distance to set good weight in DecisionMatrix for POI coefficient only
     */
    public static int getMaxDistance() {
        return maxDistance;
    }

    public static void setWidthBoard(int newWidthBoard) {
        widthBoard = newWidthBoard;
    }

    public static void setHeightBoard(int newHeightBoard) {
        heightBoard = newHeightBoard;
    }

    public static void setNumberChoiceDecision(int newnumberChoiceDecision) {
        numberChoiceDecision = newnumberChoiceDecision;
    }

    public static void setEffectiveSpeed(int newEffectiveSpeed) {
        Parameter.effectiveSpeed = newEffectiveSpeed;
    }

    /**
     * Max Distance to set good weight in DecisionMatrix for Escape coefficient only
     */
    public static int getMaxFearDistance() {
        return maxFearDistance;
    }

    public static int getMaxAmountBrought() {
        return maxAmountBrought;
    }

    public static void setMaxAmountBrought(int newMaxAmountBrought) {
        maxAmountBrought = newMaxAmountBrought;
    }

    public static void setMaxFearDistance(int maxFearDistance) {
        Parameter.maxFearDistance = maxFearDistance;
    }

    public static void setResourcesParameters(double waterUp, double mountainDown, double mountainUp, double stoneDown, double stoneUp, double goldDown, double goldUp, double woodDown) {
        resourcesParameters[0] = waterUp;
        resourcesParameters[1] = mountainDown;
        resourcesParameters[2] = mountainUp;
        resourcesParameters[3] = stoneDown;
        resourcesParameters[4] = stoneUp;
        resourcesParameters[5] = goldDown;
        resourcesParameters[6] = goldUp;
        resourcesParameters[7] = woodDown;
    }

    public static void setResourcesParametersForNormalMap() {
        resourcesParameters[0] = 0.15;
        resourcesParameters[1] = 0.2;
        resourcesParameters[2] = 0.24;
        resourcesParameters[3] = 0.455;
        resourcesParameters[4] = 0.46;
        resourcesParameters[5] = 0.555;
        resourcesParameters[6] = 0.56;
        resourcesParameters[7] = 0.7;
    }

    public static void setResourcesParametersForPlainMap() {
        resourcesParameters[0] = 0.1;
        resourcesParameters[1] = 0.23;
        resourcesParameters[2] = 0.24;
        resourcesParameters[3] = 0.457;
        resourcesParameters[4] = 0.46;
        resourcesParameters[5] = 0.557;
        resourcesParameters[6] = 0.56;
        resourcesParameters[7] = 0.85;
    }

    public static void setResourcesParametersForAquaticMap() {
        resourcesParameters[0] = 0.4;
        resourcesParameters[1] = 0.45;
        resourcesParameters[2] = 0.46;
        resourcesParameters[3] = 0.485;
        resourcesParameters[4] = 0.49;
        resourcesParameters[5] = 0.557;
        resourcesParameters[6] = 0.56;
        resourcesParameters[7] = 0.82;
    }

    public static void setMaxDistance(int newMaxDistance) {
        maxDistance = newMaxDistance;
    }

    public static boolean isGeneralHold() {
        return generalHold;
    }

    public static void setGeneralHold(boolean generalHold) {
        Parameter.generalHold = generalHold;
    }

    public static boolean isBeingHold() {
        return beingHold;
    }

    public static void setBeingHold(boolean beingHold) {
        Parameter.beingHold = beingHold;
    }

    public static boolean isGameHold() {
        return gameHold;
    }

    public static void setGameHold(boolean gameHold) {
        Parameter.gameHold = gameHold;
    }

    public static int getVillagerSpeed() {
        return villagerSpeed;
    }

    public static void setVillagerSpeed(int villagerSpeed) {
        Parameter.villagerSpeed = villagerSpeed;
    }

    public static int getVillagerVisionRadius() {
        return villagerVisionRadius;
    }

    public static void setVillagerVisionRadius(int villagerVisionRadius) {
        Parameter.villagerVisionRadius = villagerVisionRadius;
    }

    public static int getAnimalSpeed() {
        return animalSpeed;
    }

    public static int getAnimalVisionRadius() {
        return animalVisionRadius;
    }

    public static int getTargetWeight() {
        return targetWeight;
    }

    public static void setGameDelay(int gameDelay) {
        Parameter.gameDelay = gameDelay;
    }
    
    
}
